const express = require('express');
const app = express();
const path = require('path');
const fs = require('fs');
const mysql = require('mysql');
app.listen(3000, () => { console.log('服务器已开启') });
app.get('/', (req, res) => {
    res.sendFile(path.join(__dirname, '1.前端.html'))
})
app.use(express.urlencoded({ extended: false }));
app.use(express.json());

app.get('/index', (req, res) => { res.send({ code: 200, cur: req.query, msg: 'ok---get' }) });
app.post('/index', (req, res) => { res.send({ code: 200, cur: req.body, msg: 'ok---post' }) });
app.delete('/index', (req, res) => { res.send({ code: 200, cur: req.body, msg: 'ok---delete' }) });
app.put('/index', (req, res) => { res.send({ code: 200, msg: 'ok---put' }) });
